//+-+-+-+-+
//|N|C|O|M|
//+-+-+-+-+---------------------------- Copyright 2009 scott a dixon [archxs] -+
//|                                                                            |
//| This file is part of the NanoCOM project <http://code.google.com/p/ncom/>. |
//|                                                                            |
//| Nano COM is free software: you can redistribute it and/or modify           |
//| it under the terms of the GNU Lesser General Public License as published   |
//| by the Free Software Foundation, either version 3 of the License, or       |
//| (at your option) any later version.                                        |
//|                                                                            |
//| Nano COM is distributed in the hope that it will be useful,                |
//| but WITHOUT ANY WARRANTY; without even the implied warranty of             |
//| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              |
//| GNU Lesser General Public License for more details.                        |
//|                                                                            |
//| You should have received a copy of the GNU General Public License          |
//| along with the Nano COM source.  If not, see                               |
//| <http://www.gnu.org/licenses/>.                                            |
//|                                                                            |
//+----------------------------------------------------------------------------+
#ifndef NCOM_PLATFORM_H_
#define NCOM_PLATFORM_H_
/**
 * Platform Abstraction for all NCOM objects.
 */
//+----------------------------------------------------------------------------+
//| C MACRO DIRECTORY                                                          |
//+----------------------------------------------------------------------------+
//| The following macros will be (must be) defined for each target platform.   |
//| Because C macros cannot be overridden they are listed here in comment form |
//| as a convenience (so you don't have to go fishing through all the platform |
//| header files).                                                             |
//+----------------------------------------------------------------------------+
/*
 * macro               | template | return type | arguments
 *                     | description
 *                     | example
 * ----------------------------------------------------------------------------+
 * NCOM_INLINE           pragma     NA            none
 *                       Use after a function's scope and before a function's
 *                       return type to force the compiler to inline the
 *                       function. Most compilers should error if the inline
 *                       cannot be applied when this pragma is used.
 */
//+----------------------------------------------------------------------------+


#ifdef GNUNIX
#include "platformLinux.h"
#endif

#include "platformGeneric.h"

//+----------------------------------------------------------------------------+
//| IUnknown                                                                   |
//+----------------------------------------------------------------------------+
/**
 * Defining COM interface implemented by all COM complaint objects.
 */
interface IUnknown
{
    virtual NCOM_METHOD_DEF QueryInterface(IID& riid, void **ppvObject) NCOM_METHOD_ATTRIBUTES = 0;
    virtual ULONG NCOM_METHOD_SPEC AddRef(void) NCOM_METHOD_ATTRIBUTES = 0;
    virtual ULONG NCOM_METHOD_SPEC Release(void) NCOM_METHOD_ATTRIBUTES = 0;
};

// +--------------------------------------------------------------------------+
// | GLOBAL METHODS                                                           |
// +--------------------------------------------------------------------------+
/**
 * Used to compare to GUID structures for equity.
 * @param  inLeft   One GUID to compare.
 * @param  inRight  Another GUID to compare.
 * @return <code>true</code> if the two GUIDs are identical otherwise returns
 *         <code>false</code>
 */
static bool NCOM_FORCE_INLINE compareGuid(const GUID& inLeft, const GUID& inRight);


static void NCOM_FORCE_INLINE atomic_add(int* operand, int incr);


#endif /* NCOM_PLATFORM_H_ */
